home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / RIGHT.dxr / 00128.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  1.1 KB  |  38 lines

  1. on AngleFun SpLine
  2.   puppetSprite(SpLine, 1)
  3.   set the trails of sprite SpLine to 1
  4.   set x to the width of sprite SpLine
  5.   set y to the height of sprite SpLine
  6.   set r to float(sqrt((x * x) + (y * y)))
  7.   set theta to -float(atan(float(y) / float(x)))
  8.   set x0 to the left of sprite SpLine
  9.   set y0 to the top of sprite SpLine
  10.   repeat with n = 0 to 75
  11.     set the foreColor of sprite SpLine to random(250)
  12.     set theta to theta + 0.01745
  13.     set x1 to x0 + (r * cos(theta))
  14.     set y1 to y0 - (r * sin(theta))
  15.     drawLine(SpLine, y0, x0, y1, x1)
  16.     updateStage()
  17.     startTimer()
  18.     repeat while the timer < 1
  19.       nothing()
  20.     end repeat
  21.   end repeat
  22.   repeat with n = 0 to 75
  23.     set the foreColor of sprite SpLine to random(250)
  24.     set theta to theta - 0.01745
  25.     set x1 to x0 + (r * cos(theta))
  26.     set y1 to y0 - (r * sin(theta))
  27.     drawLine(SpLine, y0, x0, y1, x1)
  28.     updateStage()
  29.     startTimer()
  30.     repeat while the timer < 1
  31.       nothing()
  32.     end repeat
  33.   end repeat
  34.   puppetSprite(SpLine, 0)
  35.   set the trails of sprite SpLine to 0
  36.   updateStage()
  37. end
  38.